package com.xu.cloud.sample.service.processor;

import com.xu.cloud.common.template.AbstractRequestTemplate;
import com.xu.cloud.common.util.AssertUtil;
import com.xu.cloud.sample.api.dto.XuApiTestReq;
import com.xu.cloud.sample.api.dto.XuApiTestResp;
import org.springframework.stereotype.Service;

/**
 * @author xuguan
 * @since 2025/1/21
 */
@Service
public class XuApiTestProcessor extends AbstractRequestTemplate<XuApiTestReq, XuApiTestResp> {
    @Override
    public void recv(XuApiTestReq XuApiTestReq) {
        super.recv(XuApiTestReq);
    }

    @Override
    public void valid(XuApiTestReq XuApiTestReq) {
        AssertUtil.assertNotNull(XuApiTestReq);
        AssertUtil.assertNotNull(XuApiTestReq.getId());
    }

    @Override
    public void check(XuApiTestReq XuApiTestReq) {
    }

    @Override
    public void preRequest(XuApiTestReq XuApiTestReq) {
        super.preRequest(XuApiTestReq);
    }

    @Override
    public XuApiTestResp request(XuApiTestReq XuApiTestReq) {
        final XuApiTestResp response = new XuApiTestResp();
        response.setName("zhangsan");
        response.setMobileNo("13612341234");
        response.setIdNo("531123199001012321");
        response.setEmail("16789093912@qq.com");
        return response;
    }

    @Override
    public void postRequest(XuApiTestReq XuApiTestReq, XuApiTestResp XuApiTestResp, Exception exception) {

    }
}
